package xin.yogee.ms.module.sys.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import xin.yogee.ms.module.sys.entity.SysUser;
import xin.yogee.ms.module.sys.mapper.SysUserMapper;
import xin.yogee.ms.module.sys.service.ISysUserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 前台用户 服务实现类
 * </p>
 *
 * @author jackieQ
 * @since 2019-02-14
 */
@Service
public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements ISysUserService {

    @Resource
    private SysUserMapper sysUserMapper;

    @Override
    public SysUser getByPhone(String phone) {
        return sysUserMapper.getByPhone(phone);
    }

    @Override
    public List<SysUser> getListByDepartId(String departId) {
        return sysUserMapper.getListByDepartId(departId);
    }

    @Override
    public List<SysUser> getTreeList() {
        return sysUserMapper.getTreeList();
    }

    @Override
    public SysUser getLeaderByUserId(String userId) {
        return sysUserMapper.getLeaderByUserId(userId);
    }

    @Override
    public List<SysUser> getAllUserByDepartId(String nodeId) {
        return sysUserMapper.getAllUserByDepartId(nodeId);
    }

    @Override
    public SysUser getLeaderByLeaderId(String userId) {
        return sysUserMapper.getLeaderByLeaderId(userId);
    }

    @Override
    public SysUser getUserDepartById(String publisherId) {
        return sysUserMapper.getUserDepartById(publisherId);
    }

    @Override
    public SysUser getById(String id) {
        return sysUserMapper.getById(id);
    }

    @Override
    public IPage<SysUser> getList(Page<SysUser> ylUserPage) {
        return sysUserMapper.getList(ylUserPage);
    }
}
